/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package arreglos;

/**
 *
 * @author curso
 */
public class MiArreglo {
    public static void main(String[] args) {
        /*
         * Forma explícita
         */
        
        int arr[] = new int[10];
        //imprimir uno por uno
        System.out.println(arr[0]);
        System.out.println(arr[1]);
        System.out.println(arr[2]);
        
        //modificar los valores del arreglo
        arr[1] = 80;
        arr[2] = 160;
        
        //imprimir todos
        for (int i = 0; i < arr.length; i++) {
            System.out.println("Arreglo posición "+ i + " :" + arr[i]);
        }
        
        /*Forma implicita
         * 
         */
        
        int a[] = {1,2,3,4,5,6,7,8,9};
        for (int i = 0; i < a.length; i++) {
           System.out.println("Arreglo posición "+ i + " :" + a[i]);
        }
     
        System.out.println("Usando For-each");
        
    }
}
